Flowchart for coding problems
Flowchart for coding problems
Questions to ask:
- What is the intuition (dp? greedy? math? graph? invert? patterns?)
- Unique answer or multiple? Possible to not have an answer?
- Is the data sorted? Is it distinct? What are the constraints?
- Halves/Quarters, node count, reverse, sliding window, sum, average, prefix sum, even/odds, bitflags?
- Strictly increasing or decreasing? Multiplication vs addition optimizations?
- What time and space complexities are we targeting?
- Any hints?
- INCREMENTAL DEBUGGING
- How will solution scale and along which axes will it be optimized? (throughput? latency? qps? ux? cost? cache? networking traffic? storage? state (lack of side effects? )